package com.example.quiz.service;

import com.example.quiz.model.Question;
import java.util.List;

public interface QuestionService extends BaseService<Question> {

    // 获取分页题目列表
    List<Question> getPagedQuestions(int page, int size, Long categoryId, Integer difficulty);

    // 获取总数
    int getTotalCount(Long categoryId, Integer difficulty);

    // 根据分类获取题目
    List<Question> getByCategoryId(Long categoryId);

    // 根据难度获取题目
    List<Question> getByDifficulty(Integer difficulty);

    // 获取随机题目
    List<Question> getRandomQuestions(int limit);

    // 检查答案
    boolean checkAnswer(Long questionId, String answer);

    // 记录答题
    void recordAnswer(Long userId, Long questionId, String answer, boolean isCorrect);

    // 获取错题
    List<Question> getWrongQuestions(Long userId);
}
